#ifndef _tenacitas__balance_line__test2_h_
#define _tenacitas__balance_line__test2_h_


#include <list>
#include <cstdint>
#include <memory>
#include <algorithm>
#include <string>
#include <iostream>
#include <fstream>
#include <chrono>
#include <thread>

#include <tenacitas_balance_line/balance_line.h>
#include <tenacitas_text_log_file/logger.h>

#include <boost/filesystem.hpp>

using namespace boost;


namespace tenacitas {
    /** namespace for the project */
    namespace balance_line {
        namespace test2 {


            typedef text_log_file::logger logger;
            typedef text_log_file::text_line text_line;
            
            
            /** */
            struct text_log_file {

                typedef std::shared_ptr<text_log_file> ptr;
                typedef text_line data;
                typedef text_line::ptr data_ptr;


                text_log_file( const std::string & p_file_name )
                    :m_file( p_file_name.c_str( ) ),
                     m_line( text_line::create( ) ) { }
                             

                data_ptr read() {
                    if ( m_line->read( m_file ) ) {
                        return m_line;
                    }
                    return data_ptr( );
                }

            private:
                std::ifstream m_file;
                data_ptr m_line;                
            };

            /** */
            struct output {
                void add( text_line::ptr p_line ) {
                    std::cout << *p_line << std::endl;
                }
            };

            
            /** runs the test */
            void run( );

            void f0( );

        }
    }
}

#endif
